<?php
namespace app\admin\model;
use think\Model;


class Customer extends Model {
    
   
    /**
     * 数据表主键
     * @var string
     */

    protected $pk = 'id';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = true;
    
     /**
     * 模型名称
     * @var string
     */
    protected $name = 'customer';

    public function media()
    {
        return $this->hasOne('mediaId', 'media_id', 'media_id')->bind(['media_url'=>'url']);
    }


    public function medias()
    {
        return $this->hasOne('mediaId', 'media_id', 'thumb_media_id')->bind(['media_url'=>'url']);
    }
}

